<%@ page language="java" import="java.util.*,ms.platform.system.model.*"
	pageEncoding="UTF-8"%>
	<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<!DOCTYPE html>
<html lang="en">
<head>
<base href="<%=basePath%>">
<title>密码修改</title>
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">

<!-- 引用新样式 start -->
<jsp:include page="../../jsp/public.jsp" flush="true"/>
<!-- end -->
<script type="text/javascript">
	function checkData(){
		var newPassword = $("#newPassword").val();
		var confirmPassword = $("#confirmPassword").val();
		if (newPassword == "" || newPassword == null || newPassword == "undefined") {
			msgFeedBack("请填写新密码","#newPassword");
			return false;
		}else if(newPassword.length<6){
			msgFeedBack("密码长度必须大于或等于6个字符","#newPassword");
			return false;
		}
		if (confirmPassword == "" || confirmPassword == null || confirmPassword == "undefined") {
			msgFeedBack("请填写确认密码","#confirmPassword");
			return false;
		}else if(confirmPassword.length<6){
			msgFeedBack("密码长度必须大于6个字符","#confirmPassword");
			return false;
		}
		if(confirmPassword != newPassword){
			msgFeedBack("密码不一致","#confirmPassword");
			return false;
		}
		return true;
	}
	
	function updatePassword(){
		var newPassword = $("#newPassword").val();
		if(checkData()){
			var url = basePath + "/bus/progress/updatePassword?password="+newPassword;
			showLoad();
				$.ajax({
					type : "post",
					url : url,
					data : null,
					dataType : "json",
					success : function(data) {
						msgPrompt(data.message);
						$("#newPassword").val("");
						$("#confirmPassword").val("");
					}
			});
		}
	}
	function toIndex(){
		
	}
</script>
<body>
	<div class="col-lg-12">
                <div class="index-nav-right">
                    <div class="index-nav-right-header"><span>当前位置>密码修改</span></div>
                </div>

                <div class="add-one-right">
                  
                        <div class="row">
                             <div class="addInfo-one" id="departmentId">
                        <div class="row add-one-form-rowHeight">
                            <div class="form-group col-lg-5 col-lg-offset-1">
                                <label class="col-lg-3 control-label add-one-form-label">新密码<span class = "font-red">*</span>:</label>
                                <div class="col-lg-7">
                                    <input type="password" class="form-control" id="newPassword" value="">
                                </div>
                            </div>
                            <div class="form-group col-lg-5">
                                
                            </div>
                        </div>
                        <div class="row add-one-form-rowHeight">
                            <div class="form-group col-lg-5 col-lg-offset-1">
                                <label class="col-lg-3 control-label add-one-form-label">确认密码<span class = "font-red">*</span>:</label>
                                <div class="col-lg-7">
                                    <input type="password" class="form-control" id="confirmPassword" value="">
                                </div>
                            </div>
                            <div class="form-group col-lg-5">
                               
                            </div>
                        </div>
                        <div class="add-one-form-rowHeight">
                                <div class="" style="border:0px solid red">
                                    <button style="width:50px;margin-left: 300px;"  type="button" class="btn navbar-default" onClick="updatePassword()">提交</button>
                                </div>
                            </div>
                    </div>
                        </div>
                    </div>
                    <!--表单信息输入第三步E-->
                    <!--表单信息输入-->
					<input type="text" hidden = "true" id="userId" value = "${userId}"/> 
                </div>
</body>
</html>